{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache();">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {dr_form_hidden(['page' => $page])}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="{dr_icon($module.icon)}"></i> {$module.name} - {dr_lang('评论设置')} </a>
                </li>
                <li class="{if $page==1}active{/if}">
                    <a href="#tab_1" data-toggle="tab" onclick="$('#dr_page').val('1')"> <i class="fa fa-comments"></i> {dr_lang('评分点评')} </a>
                </li>
                <li class="{if $page==4}active{/if}">
                    <a href="#tab_4" data-toggle="tab" onclick="$('#dr_page').val('4')"> <i class="fa fa-comments"></i> {dr_lang('后台评论显示字段')} </a>
                </li>
                <li class="hide {if $page==5}active{/if}">
                    <a href="#tab_5" data-toggle="tab" onclick="$('#dr_page').val('5')"> <i class="fa fa-send"></i> {dr_lang('自定义SEO')} </a>
                </li>
                <li class=" {if $page==6}active{/if}">
                    <a href="#tab_6" data-toggle="tab" onclick="$('#dr_page').val('6')"> <i class="fa fa-user"></i> {dr_lang('权限设置')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">
                <div class="tab-pane {if 6 == $page}active{/if}" id="tab_6">
                    <div class="form-body">


                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论方式')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[my]" value="1" {if $data['my']}checked{/if} /> {dr_lang('不能对自己')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[my]" value="0" {if !$data['my']}checked{/if} /> {dr_lang('不限制')} <span></span></label>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('评论权限')}</label>
                            <div class="col-md-9">

                                <div class="table-scrollable ">
                                    <table class="table table-striped table-bordered  table-checkable dataTable">
                                        <tbody>
<?php
 $group = [ 0 => dr_lang('游客') ];
if ($ci->member_cache['group']) {
foreach ($ci->member_cache['group'] as $t) {
$group[$t['id']] = dr_lang($t['name']);
}
}
?>
                                        {loop $group $i $t}
                                        <tr class="odd gradeX">
                                            <td width="200" style="text-align: left;padding-left:10px;">{$t}</td>
                                            <td>

                                                <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                                                    {dr_lang('发表评论')}
                                                    <input type="checkbox" class="checkboxes" name="data[comment_add][{$i}]" value="1" {if $data['comment_add'][$i]}checked{/if} />
                                                    <span></span>
                                                </label>&nbsp;&nbsp;&nbsp;&nbsp;
                                                <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                                                    {dr_lang('审核评论')}
                                                    <input type="checkbox" class="checkboxes" name="data[comment_verify][{$i}]" value="1" {if $data['comment_verify'][$i]}checked{/if} />
                                                    <span></span>
                                                </label>&nbsp;&nbsp;&nbsp;&nbsp;
                                                {if dr_is_app('explog')}
                                                <div class="input-inline input-small">
                                                    <div class="input-group">
                                                        <input type="text" name="data[comment_exp][{$i}]" value="{$data['comment_exp'][$i]}" class="form-control" placeholder="">
                                                        <span class="input-group-addon">+{SITE_EXPERIENCE}</span>
                                                    </div>
                                                </div>&nbsp;&nbsp;&nbsp;&nbsp;
                                                {/if}
                                                {if dr_is_app('scorelog')}
                                                <div class="input-inline input-small">
                                                    <div class="input-group">
                                                        <input type="text" name="data[comment_score][{$i}]" value="{$data['comment_score'][$i]}" class="form-control" placeholder="">
                                                        <span class="input-group-addon">+{SITE_SCORE}</span>
                                                    </div>
                                                </div>
                                                {/if}

                                            </td>
                                        </tr>
                                        {/loop}
                                        </tbody>
                                    </table>
                                </div>




                            </div>
                        </div>

                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论回复权限')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="1" {if $data['reply']==1}checked{/if} /> {dr_lang('都允许')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="2" {if $data['reply']==2}checked{/if} /> {dr_lang('仅自己')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[reply]" value="0" {if !$data['reply']}checked{/if} /> {dr_lang('禁止所有')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('是否统计回复')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[ct_reply]" value="1" {if $data['ct_reply']==1}checked{/if} /> {dr_lang('统计')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[ct_reply]" value="0" {if !$data['ct_reply']}checked{/if} /> {dr_lang('不统计')} <span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('将评论回复也计算到评论总数之中')}</span>
                            </div>
                        </div>





                    </div>
                </div>


                <div class="tab-pane {if 0 == $page}active{/if}" id="tab_0">
                    <div class="form-body">

                        <div class="form-group">
                            <label class="col-md-2 control-label" style="padding-top:5px;">{dr_lang('评论功能')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[use]" value="1" {if $data['use']}checked{/if} data-on-text="{dr_lang('已开启')}" data-off-text="{dr_lang('已关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">

                                <span class="help-block">{dr_lang('选择关闭将不能进行评论')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label" style="padding-top:5px;">{dr_lang('命名名称')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[cname]" value="{php echo $data['cname'] ? htmlspecialchars($data['cname']) : dr_lang('评论');}" ></label>
                                <span class="help-block">{dr_lang('系统默认是"评论"，可以定义为"回复"、"论坛"、"帖子"、"点评"等名称')}</span>
                            </div>
                        </div>
                        <div class="form-group pt" >
                            <label class="col-md-2 control-label">{dr_lang('评论次数')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[num]" value="1" {if $data['num']}checked{/if} /> {dr_lang('评论一次')} <span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[num]" value="0" {if !$data['num']}checked{/if} /> {dr_lang('不限制')} <span></span></label>
                                </div>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('电脑列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize]" value="{intval($data['pagesize'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在电脑网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('手机列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize_mobile]" value="{intval($data['pagesize_mobile'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在手机网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('API接口列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[pagesize_api]" value="{intval($data['pagesize_api'])}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在API数据请求时每页返回的数量')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('前端排列顺序')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control input-xlarge" type="text" name="data[order]" value="{$data['order']}" ></label>
                                <span class="help-block">{dr_lang('前端显示排列的排序方式，默认是时间最新排列最前')}</span>
                            </div>
                        </div>



                    </div>
                </div>

                <div class="tab-pane {if 1 == $page}active{/if}" id="tab_1">
                    <div class="form-body">

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('开启点评')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[review][use]" value="1" {if $data['review']['use']}checked{/if} data-on-text="{dr_lang('是')}" data-off-text="{dr_lang('否')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('总分形式')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="5" {if $data['review']['score']==5}checked{/if} /> {dr_lang('五分制')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="10" {if $data['review']['score']==10}checked{/if} /> {dr_lang('十分制')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][score]" value="100" {if $data['review']['score']==100}checked{/if} /> {dr_lang('百分制')}<span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('显示主题的各个评分项的数值形式')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('分数小数点')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="0" {if !$data['review']['point']}checked{/if} /> {dr_lang('不显示')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="1" {if $data['review']['point']==1}checked{/if} /> {dr_lang('一位数')}<span></span></label>
                                    <label class="mt-radio"><input type="radio" name="data[review][point]" value="2" {if $data['review']['point']==2}checked{/if} /> {dr_lang('两位数')}<span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('各项得分的显示是否显示小数点')}</span>
                            </div>
                        </div>
                        <div class="form-group dr_one">
                            <label class="col-md-2 control-label">{dr_lang('点评星级')}</label>
                            <div class="col-md-9">
                                {loop $data['review']['value'] $ii $t}
                                <label><input class="form-control" type="text" name="data[review][value][{$ii}][name]" value="{htmlspecialchars((string)$t['name'])}" size="15" /></label>
                                {/loop}
                            </div>
                        </div>
                        <div class="form-group dr_one">
                            <label class="col-md-2 control-label">{dr_lang('点评选项')}</label>
                            <div class="col-md-9">
                                {loop $data['review']['option'] $ii $t}
                                <p>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[review][option][{$ii}][use]" {if $t.use}checked{/if} value="1"> <span></span></label>
                                    <label><input class="form-control  input-large" type="text" name="data[review][option][{$ii}][name]" value="{htmlspecialchars((string)$t['name'])}" size="15" /></label>
                                </p>
                                {/loop}
                            </div>
                        </div>


                    </div>
                </div>


                <div class="tab-pane {if $page==4}active{/if}" id="tab_4">
                    <div class="form-body">

                        <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                            <thead>
                            <tr class="heading">
                                <th class="myselect">
                                    {dr_lang('显示')}
                                </th>
                                <th width="180"> {dr_lang('字段')} </th>
                                <th width="100"> {dr_lang('类别')} </th>
                                <th width="150"> {dr_lang('名称')} </th>
                                <th width="100"> {dr_lang('宽度')} </th>
                                <th> {dr_lang('回调方法')} </th>
                            </tr>
                            </thead>
                            <tbody class="field-sort-items">
                            {loop $comment_field $n $t}
                            {if $t.name}
                            <tr class="odd gradeX">
                                <td class="myselect">
                                    <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                                        <input type="checkbox" class="checkboxes" name="data[comment_list_field][{$t.fieldname}][use]" value="1" {if $data['comment_list_field'][$t.fieldname]['use']} checked{/if} />
                                        <span></span>
                                    </label>
                                </td>
                                <td>{dr_lang($t.name)} ({$t.fieldname})</td>
                                <td>{$t.fieldtype}</td>
                                <td><input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][name]" value="{php echo $data['comment_list_field'][$t.fieldname]['name'] ? htmlspecialchars($data['comment_list_field'][$t.fieldname]['name']) : $t.name}" /></td>
                                <td> <input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][width]" value="{htmlspecialchars((string)$data['comment_list_field'][$t.fieldname]['width'])}" /></td>
                                <td> <div class="input-group" style="width:250px">
                                        <span class="input-group-btn">
                                            <a class="btn btn-success" href="javascript:dr_call_alert();">{dr_lang('回调')}</a>
                                        </span>
                                    <input class="form-control" type="text" name="data[comment_list_field][{$t.fieldname}][func]" value="{htmlspecialchars((string)$data['comment_list_field'][$t.fieldname]['func'])}" />
                                </div></td>
                            </tr>
                            {/if}
                            {/loop}
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="tab-pane {if $page==5}active{/if}" id="tab_5">
                    <div class="form-body">

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('SEO标题')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control " style="height:70px" name="data[seo][show_title]">{$data['seo']['show_title']}</textarea>
                                <span class="help-block">
                                    <button class="btn btn-xs green" onclick="dr_seo_title_rule()" type="button"><i class="fa fa-code"></i> {dr_lang('可用通配符标签')}</button>
                                    <script>
                                        function dr_seo_title_rule() {
                                            layer.alert('{join}	SEO连接符号，默认“_”<br>'+
                                                '[{page}]	分页页码<br>'+
                                                '{modulename}	当前模块的名称<br>'+
                                                '{catname}	当前栏目名称<br>'+
                                                '{catpname}	当前栏目带层次的栏目名称<br>'+
                                                '{title}	当前内容的标题字段<br>'+
                                                '支持网站系统常量，格式：{大写的常量名称}，<br>如：{SITE_NAME}表示网站名称<br>'+
                                                ''+
                                                '', {
                                                shade: 0,
                                                title: '',
                                                btn: []
                                            });
                                        }
                                    </script>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('SEO关键字')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control " style="height:70px" name="data[seo][show_keywords]">{$data['seo']['show_keywords']}</textarea>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('SEO描述信息')}</label>
                            <div class="col-md-9">
                                <textarea class="form-control " style="height:90px" name="data[seo][show_description]">{$data['seo']['show_description']}</textarea>
                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>




{template "footer.html"}